package cn.shopping.core.daomanager.immutable;

import cn.shopping.common.daomanager.CommonDaoManager;
import cn.shopping.core.dbo.GoodsFileDO;
import org.springframework.util.CollectionUtils;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;


/**
 * 代码自动生成，请不要修改，切记！！！
 */
public interface ImmutableGoodsFileDaoManager extends CommonDaoManager<GoodsFileDO,Long> {


        public List<GoodsFileDO> listByClfGoodsId(Long clfGoodsId, String... fieldNames);

        public Map<Long,GoodsFileDO> mapByClfGoodsId(Long clfGoodsId, String... fieldNames);

        public Integer countByClfGoodsId(Long clfGoodsId);

        public default GoodsFileDO singleResultByClfGoodsId(Long clfGoodsId,String... fieldNames){
             List<GoodsFileDO> list=this.listByClfGoodsId(clfGoodsId,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<GoodsFileDO>> groupingByClfGoodsId(Long clfGoodsId, Function<GoodsFileDO, T> mapper, String... fieldNames){
             List<GoodsFileDO> list=this.listByClfGoodsId(clfGoodsId,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByClfGoodsId(GoodsFileDO updateDO, Long clfGoodsId);

        public Integer updateAllFieldsByClfGoodsId(GoodsFileDO updateDO,  Long clfGoodsId);

        public Integer deleteByClfGoodsId( Long clfGoodsId);






        public List<GoodsFileDO> listByInClfGoodsId(Collection<Long> clfGoodsIdList, String... fieldNames);

         public Map<Long,GoodsFileDO> mapByInClfGoodsId(Collection<Long> clfGoodsIdList, String... fieldNames);

         public Integer countByInClfGoodsId(Collection<Long> clfGoodsIdList);

         public default GoodsFileDO singleResultByInClfGoodsId(Collection<Long> clfGoodsIdList,String... fieldNames){
              List<GoodsFileDO> list=this.listByInClfGoodsId(clfGoodsIdList,fieldNames);
              return CollectionUtils.isEmpty(list)?null:list.get(0);
         }

          public default <T> Map<T,List<GoodsFileDO>> groupingByInClfGoodsId(Collection<Long> clfGoodsIdList, Function<GoodsFileDO, T> mapper, String... fieldNames){
              List<GoodsFileDO> list=this.listByInClfGoodsId(clfGoodsIdList,fieldNames);
              if(CollectionUtils.isEmpty(list)){
                 return new HashMap<>();
              }
              return list.stream().collect(Collectors.groupingBy(mapper));
          }

         public Integer updateNotNullFieldsByInClfGoodsId(GoodsFileDO updateDO, Collection<Long> clfGoodsIdList);

         public Integer updateAllFieldsByInClfGoodsId(GoodsFileDO updateDO,  Collection<Long> clfGoodsIdList);

         public Integer deleteByInClfGoodsId( Collection<Long> clfGoodsIdList);
        public List<GoodsFileDO> listByFileType(Integer fileType, String... fieldNames);

        public Map<Long,GoodsFileDO> mapByFileType(Integer fileType, String... fieldNames);

        public Integer countByFileType(Integer fileType);

        public default GoodsFileDO singleResultByFileType(Integer fileType,String... fieldNames){
             List<GoodsFileDO> list=this.listByFileType(fileType,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<GoodsFileDO>> groupingByFileType(Integer fileType, Function<GoodsFileDO, T> mapper, String... fieldNames){
             List<GoodsFileDO> list=this.listByFileType(fileType,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByFileType(GoodsFileDO updateDO, Integer fileType);

        public Integer updateAllFieldsByFileType(GoodsFileDO updateDO,  Integer fileType);

        public Integer deleteByFileType( Integer fileType);






        public List<GoodsFileDO> listByInFileType(Collection<Integer> fileTypeList, String... fieldNames);

         public Map<Long,GoodsFileDO> mapByInFileType(Collection<Integer> fileTypeList, String... fieldNames);

         public Integer countByInFileType(Collection<Integer> fileTypeList);

         public default GoodsFileDO singleResultByInFileType(Collection<Integer> fileTypeList,String... fieldNames){
              List<GoodsFileDO> list=this.listByInFileType(fileTypeList,fieldNames);
              return CollectionUtils.isEmpty(list)?null:list.get(0);
         }

          public default <T> Map<T,List<GoodsFileDO>> groupingByInFileType(Collection<Integer> fileTypeList, Function<GoodsFileDO, T> mapper, String... fieldNames){
              List<GoodsFileDO> list=this.listByInFileType(fileTypeList,fieldNames);
              if(CollectionUtils.isEmpty(list)){
                 return new HashMap<>();
              }
              return list.stream().collect(Collectors.groupingBy(mapper));
          }

         public Integer updateNotNullFieldsByInFileType(GoodsFileDO updateDO, Collection<Integer> fileTypeList);

         public Integer updateAllFieldsByInFileType(GoodsFileDO updateDO,  Collection<Integer> fileTypeList);

         public Integer deleteByInFileType( Collection<Integer> fileTypeList);
        public List<GoodsFileDO> listByUploadId(Long uploadId, String... fieldNames);

        public Map<Long,GoodsFileDO> mapByUploadId(Long uploadId, String... fieldNames);

        public Integer countByUploadId(Long uploadId);

        public default GoodsFileDO singleResultByUploadId(Long uploadId,String... fieldNames){
             List<GoodsFileDO> list=this.listByUploadId(uploadId,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<GoodsFileDO>> groupingByUploadId(Long uploadId, Function<GoodsFileDO, T> mapper, String... fieldNames){
             List<GoodsFileDO> list=this.listByUploadId(uploadId,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByUploadId(GoodsFileDO updateDO, Long uploadId);

        public Integer updateAllFieldsByUploadId(GoodsFileDO updateDO,  Long uploadId);

        public Integer deleteByUploadId( Long uploadId);






        public List<GoodsFileDO> listByInUploadId(Collection<Long> uploadIdList, String... fieldNames);

         public Map<Long,GoodsFileDO> mapByInUploadId(Collection<Long> uploadIdList, String... fieldNames);

         public Integer countByInUploadId(Collection<Long> uploadIdList);

         public default GoodsFileDO singleResultByInUploadId(Collection<Long> uploadIdList,String... fieldNames){
              List<GoodsFileDO> list=this.listByInUploadId(uploadIdList,fieldNames);
              return CollectionUtils.isEmpty(list)?null:list.get(0);
         }

          public default <T> Map<T,List<GoodsFileDO>> groupingByInUploadId(Collection<Long> uploadIdList, Function<GoodsFileDO, T> mapper, String... fieldNames){
              List<GoodsFileDO> list=this.listByInUploadId(uploadIdList,fieldNames);
              if(CollectionUtils.isEmpty(list)){
                 return new HashMap<>();
              }
              return list.stream().collect(Collectors.groupingBy(mapper));
          }

         public Integer updateNotNullFieldsByInUploadId(GoodsFileDO updateDO, Collection<Long> uploadIdList);

         public Integer updateAllFieldsByInUploadId(GoodsFileDO updateDO,  Collection<Long> uploadIdList);

         public Integer deleteByInUploadId( Collection<Long> uploadIdList);
        public List<GoodsFileDO> listBySeq(Long seq, String... fieldNames);

        public Map<Long,GoodsFileDO> mapBySeq(Long seq, String... fieldNames);

        public Integer countBySeq(Long seq);

        public default GoodsFileDO singleResultBySeq(Long seq,String... fieldNames){
             List<GoodsFileDO> list=this.listBySeq(seq,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<GoodsFileDO>> groupingBySeq(Long seq, Function<GoodsFileDO, T> mapper, String... fieldNames){
             List<GoodsFileDO> list=this.listBySeq(seq,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsBySeq(GoodsFileDO updateDO, Long seq);

        public Integer updateAllFieldsBySeq(GoodsFileDO updateDO,  Long seq);

        public Integer deleteBySeq( Long seq);






        public List<GoodsFileDO> listByInSeq(Collection<Long> seqList, String... fieldNames);

         public Map<Long,GoodsFileDO> mapByInSeq(Collection<Long> seqList, String... fieldNames);

         public Integer countByInSeq(Collection<Long> seqList);

         public default GoodsFileDO singleResultByInSeq(Collection<Long> seqList,String... fieldNames){
              List<GoodsFileDO> list=this.listByInSeq(seqList,fieldNames);
              return CollectionUtils.isEmpty(list)?null:list.get(0);
         }

          public default <T> Map<T,List<GoodsFileDO>> groupingByInSeq(Collection<Long> seqList, Function<GoodsFileDO, T> mapper, String... fieldNames){
              List<GoodsFileDO> list=this.listByInSeq(seqList,fieldNames);
              if(CollectionUtils.isEmpty(list)){
                 return new HashMap<>();
              }
              return list.stream().collect(Collectors.groupingBy(mapper));
          }

         public Integer updateNotNullFieldsByInSeq(GoodsFileDO updateDO, Collection<Long> seqList);

         public Integer updateAllFieldsByInSeq(GoodsFileDO updateDO,  Collection<Long> seqList);

         public Integer deleteByInSeq( Collection<Long> seqList);


}

